import { computed } from "vue"
import { useStore } from "@/store";
export const onHandleCode = computed(() => {
    const dictionaryStore = useStore();
    console.log(dictionaryStore);

    return function (type: string) {
        const { dictLabel } = dictionaryStore.state.dictionary.ryxx.filter(
            (item: any) => type === item.dictValue
        )[0];
        return dictLabel;
    };
});

export const tagColor = computed((): Function => {
    return function (type: string): string {
        return type === "0"
            ? "success"
            : type === "1"
                ? "processing"
                : "error";
    };
});

export const ryxx = computed(() => {
    const dictionaryStore = useStore();
    return dictionaryStore.state.dictionary.ryxx;
});